<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>数组求和</title>
</head>
<body>
<script>
    <!--        todo:应该利用 reduce方法快速找到基本的数学运算-->
    const array = [5, 4, 7, 8, 9, 2];
    const r1 = array.reduce((a, b) => a + b);
    console.log('%c   r1: ', 'color: MidnightBlue; background: Aquamarine; font-size: 20px;', r1);
    const max = array.reduce((a, b) => a > b ? a : b);
    console.log('%c   max: ', 'color: MidnightBlue; background: Aquamarine; font-size: 20px;', max);
    let min = array.reduce((a, b) => a < b ? a : b);
    console.log('%c   min: ', 'color: MidnightBlue; background: Aquamarine; font-size: 20px;', min);
</script>
</body>
</html>